package Thread;

import java.util.Scanner;

public class Demo5 {

    public static void main1(String[] args) {
       Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        String t1 = null;
        String t2 = null;
        int size = s1.length()+1;
        int count = 0;
        for (int i = 0; i < size; i++) {
            StringBuilder str = new StringBuilder();
            t1 = s1.substring(0,i);
            if(i == 0){
                t2 = s1;
            }else {
                t2 = s1.substring(i,s1.length());
            }
            str.append(t1).append(s2).append(t2);
            if(func(str)){
               count++;
           }
        }
        System.out.println(count);

        //插入方式
        //插入次数
        //每次都判断是否是回文数
        //通过left和right进行回文数判断
    }
     public  static boolean func(StringBuilder str){
        int left = 0;
        int right = str.length()-1;
        while (left<right){
            if (str.charAt(left++) != str.charAt(right--)){
                return false;
            }
        }
        return true;
     }
}
